#Volumen eines Zylinder
#Zylinder ::= (Kreis * Hoehe)::
#Kreis ::= (PI * r **2):: Nat => Nat ::
#test((10.0,10) => Err, (10.0,-10.0) => Err, (10.0,0) => Err, (10.0,"hallo") => Err,
#("hallo",10.0) => Err, (4,10.0) => Err)
$LOAD_PATH.unshift File.join(File.dirname(__FILE__),'..','ext_pr1/lib')
require 'ext_pr1_v4'

def zylinder(radius, hoehe)

  check_pre((
    radius.float? and
    hoehe.float? and
    hoehe > 0 and
    radius > 0
  ))
    kreis(radius) * hoehe
end


def kreis(radius)
(Math::PI * (radius ** 2))
end



